local FightInterface = require("gameLogic.fightSkill.sequence.FightInterface")
local FightSequence = class("FightSequence", FightInterface)

function FightSequence:ctor()
    FightSequence.super.ctor(self)
    self._children = {}
    self._curIndex = 1
end

function FightSequence:addChild(child)
    table.insert(self._children, child)
end

function FightSequence:_update()
    if self._curIndex > #self._children then
        self._isDone = true
    end
    local child = self._children[self._curIndex]
    if child then
        child:tick()
        if child:isDone() then
            self._curIndex = self._curIndex + 1
        end
    end
end

return FightSequence
